home *** CD-ROM | disk | FTP | other *** search
/ Virtual Sex Shoot / Virtual Sex Shoot.iso / mac / Virtual Sex Shoot / Virtual Sex Shoot.DXR / 00295.ls < prev    next >
Encoding:
Text File  |  1995-09-24  |  14.4 KB  |  509 lines

  1. global gPanoMovieID, gNavMovieID, gPathName, gLastTimeRollover, gPanoFrame, gQTVRCallBackFactory, gLastPanoMovieData, gVRSprite1, gVRSprite2, gVR, gIntroVR, gVR.PanoFilename, gVR.CurrentNodeID, gVR.CurrentHotSpotID, gVR.MouseOverHandler.Message, gVR.RolloverHotSpotHandler.Message, gVR.MouseDownHandler.Message, gVR.PanZoomStartHandler.Message, gVR.MouseStillDownHandler.Message, gVR.NodeLeaveHandler.Message
  2.  
  3. on startMovieVR
  4.   if the machineType = 256 then
  5.     StartMovieVR256()
  6.     exit
  7.   end if
  8.   set gPanoMovieID to EMPTY
  9.   set gNavMovieID to EMPTY
  10.   set gPathName to EMPTY
  11.   set gLastTimeRollover to 0
  12.   set gPanoFrame to EMPTY
  13.   set gVRSprite1 to 3
  14.   set gVRSprite2 to 4
  15.   set gVR.PanoFilename to gIntroVR
  16.   openXLib("QuickTime VR XCMDs")
  17.   RegisterComponent(the pathName & "QuickTime VR Components", EMPTY)
  18.   set gQTVRCallBackFactory to CallBackTracer(mnew)
  19.   setCallBack(#PanoMovie, gQTVRCallBackFactory)
  20. end
  21.  
  22. on stopMovieVR
  23.   if the machineType = 256 then
  24.     StopMovieVR256()
  25.     exit
  26.   end if
  27.   ClosePanoMovie()
  28.   CloseNavMovie()
  29.   closeXLib("QuickTime VR XCMDs")
  30.   if objectp(gQTVRCallBackFactory) then
  31.     gQTVRCallBackFactory(mdispose)
  32.   end if
  33. end
  34.  
  35. on OpenNavMovie pFilename, pSpriteNum, pShowOnOpen
  36.   if the machineType = 256 then
  37.     OpenNavMovie256(pFilename, pSpriteNum, pShowOnOpen)
  38.     exit
  39.   end if
  40.   CloseNavMovie()
  41.   set spriteLeft to the left of sprite pSpriteNum
  42.   set spriteTop to the top of sprite pSpriteNum
  43.   set spriteRight to the right of sprite pSpriteNum
  44.   set spriteBottom to the bottom of sprite pSpriteNum
  45.   set tNavRect to spriteLeft & "," & spriteTop & "," & spriteRight & "," & spriteBottom
  46.   set gNavMovieID to NavMovie("openMovie", "Direct", pFilename, tNavRect, "ShowPoster", "Invisible")
  47.   if gNavMovieID contains "error" then
  48.     put gNavMovieID
  49.     set gNavMovieID to EMPTY
  50.     beep()
  51.     exit
  52.   end if
  53.   if pShowOnOpen then
  54.     NavMovie("Direct", gNavMovieID, "update")
  55.   end if
  56. end
  57.  
  58. on ShowNavMovie
  59.   if the machineType = 256 then
  60.     ShowNavMovie256()
  61.     exit
  62.   end if
  63.   if gNavMovieID <> EMPTY then
  64.     NavMovie("Direct", gNavMovieID, "update")
  65.   end if
  66. end
  67.  
  68. on ZoomNavMovie pStartZoomRect, pSkipFirstFrame, pClipRect
  69.   if the machineType = 256 then
  70.     exit
  71.   end if
  72.   if gNavMovieID <> EMPTY then
  73.     set tCommand to "ZoomOutMovie" && QUOTE & pStartZoomRect & QUOTE
  74.     if not voidp(pSkipFirstFrame) then
  75.       set tCommand to tCommand & "," & pSkipFirstFrame
  76.     end if
  77.     if not voidp(pClipRect) then
  78.       set tCommand to tCommand & "," & QUOTE & pClipRect & QUOTE
  79.     end if
  80.     NavMovie("Direct", gNavMovieID, tCommand)
  81.     NavMovie("Direct", gNavMovieID, "idle")
  82.   end if
  83. end
  84.  
  85. on SetNavMovieView pHPan, pVPan
  86.   if the machineType = 256 then
  87.     SetNavMovieView256(pHPan, pVPan)
  88.     exit
  89.   end if
  90.   if gNavMovieID <> EMPTY then
  91.     NavMovie("Direct", gNavMovieID, "set", "hPanAngle", pHPan)
  92.     NavMovie("Direct", gNavMovieID, "set", "vPanAngle", pVPan)
  93.   end if
  94. end
  95.  
  96. on CloseNavMovie
  97.   if the machineType = 256 then
  98.     CloseNavMovie256()
  99.     exit
  100.   end if
  101.   if not voidp(gPanoMovieID) then
  102.     if gNavMovieID <> EMPTY then
  103.       NavMovie("Direct", gNavMovieID, "dispose")
  104.       set gNavMovieID to EMPTY
  105.     end if
  106.   end if
  107. end
  108.  
  109. on NavFrameScript pSpriteNum
  110.   if the machineType = 256 then
  111.     NavFrameScript256(pSpriteNum)
  112.     exit
  113.   end if
  114.   if (gNavMovieID <> EMPTY) and (RunningInForeground() = "true") then
  115.     if rollOver(pSpriteNum) then
  116.       NavMovie("Direct", gNavMovieID, "mouseOver")
  117.       cursor(200)
  118.       cursor(-1)
  119.     else
  120.       NavMovie("Direct", gNavMovieID, "idle")
  121.     end if
  122.   end if
  123. end
  124.  
  125. on OpenPanoMovie pFilename, pSpriteNum, pShowOnOpen
  126.   if the machineType = 256 then
  127.     OpenPanoMovie256(pFilename, pSpriteNum, pShowOnOpen)
  128.     exit
  129.   end if
  130.   ClosePanoMovie()
  131.   set spriteLeft to the left of sprite pSpriteNum
  132.   set spriteTop to the top of sprite pSpriteNum
  133.   set spriteRight to the right of sprite pSpriteNum
  134.   set spriteBottom to the bottom of sprite pSpriteNum
  135.   set tPanoRect to spriteLeft & "," & spriteTop & "," & spriteRight & "," & spriteBottom
  136.   set gPanoMovieID to PanoMovie("openMovie", "Direct", pFilename, tPanoRect)
  137.   if gPanoMovieID contains "error" then
  138.     put gPanoMovieID
  139.     set gPanoMovieID to EMPTY
  140.     beep()
  141.     exit
  142.   end if
  143.   set gPathName to ExtractPathName(pFilename)
  144.   InitPanoCallbacks()
  145.   if pShowOnOpen then
  146.     PanoMovie("Direct", gPanoMovieID, "update")
  147.   end if
  148. end
  149.  
  150. on InitPanoCallbacks
  151.   if the machineType = 256 then
  152.     InitPanoCallbacks256()
  153.     exit
  154.   end if
  155.   if not voidp(gPanoMovieID) then
  156.     if gPanoMovieID <> EMPTY then
  157.       PanoMovie("Direct", gPanoMovieID, "set", "mouseOverHandler", EMPTY)
  158.       PanoMovie("Direct", gPanoMovieID, "set", "rolloverHotSpotHandler", "sampleRolloverHandler")
  159.       PanoMovie("Direct", gPanoMovieID, "set", "mouseDownHandler", EMPTY)
  160.       PanoMovie("Direct", gPanoMovieID, "set", "panZoomStartHandler", EMPTY)
  161.       PanoMovie("Direct", gPanoMovieID, "set", "mouseStillDownHandler", EMPTY)
  162.       PanoMovie("Direct", gPanoMovieID, "set", "nodeLeaveHandler", EMPTY)
  163.     end if
  164.   end if
  165. end
  166.  
  167. on ShowPanoMovie pQuality
  168.   if the machineType = 256 then
  169.     ShowPanoMovie256(pQuality)
  170.     exit
  171.   end if
  172.   if not voidp(gPanoMovieID) then
  173.     if gPanoMovieID <> EMPTY then
  174.       if not voidp(pQuality) then
  175.         PanoMovie("Direct", gPanoMovieID, "set", "quality", pQuality)
  176.       end if
  177.       PanoMovie("Direct", gPanoMovieID, "update")
  178.     end if
  179.   end if
  180. end
  181.  
  182. on SetPanoNode pNodeID, pUpdate, pQuality
  183.   if the machineType = 256 then
  184.     SetPanoNode256(pNodeID, pUpdate, pQuality)
  185.     exit
  186.   end if
  187.   if not voidp(gPanoMovieID) then
  188.     if gPanoMovieID <> EMPTY then
  189.       PanoMovie("Direct", gPanoMovieID, "set", "nodeID", pNodeID)
  190.       if not voidp(pQuality) then
  191.         PanoMovie("Direct", gPanoMovieID, "set", "quality", pQuality)
  192.       end if
  193.       if pUpdate then
  194.         PanoMovie("Direct", gPanoMovieID, "Update")
  195.       end if
  196.     end if
  197.   end if
  198. end
  199.  
  200. on SwingPanoMovie pHPan, pVPan, pZoom, pSwingSpeed, pSwingQuality, pFinalQuality
  201.   if the machineType = 256 then
  202.     SwingPanoMovie256(pHPan, pVPan, pZoom, pSwingSpeed, pSwingQuality, pFinalQuality)
  203.     exit
  204.   end if
  205.   if not voidp(gPanoMovieID) then
  206.     if gPanoMovieID <> EMPTY then
  207.       PanoMovie("Direct", gPanoMovieID, "set", "zoomAngle", pZoom)
  208.       PanoMovie("Direct", gPanoMovieID, "set", "vPanAngle", pVPan)
  209.       PanoMovie("Direct", gPanoMovieID, "set", "hPanAngle", pHPan)
  210.       PanoMovie("Direct", gPanoMovieID, "set", "quality", pSwingQuality)
  211.       PanoMovie("Direct", gPanoMovieID, "set", "transitionMode", "swing")
  212.       PanoMovie("Direct", gPanoMovieID, "set", "transitionSpeed", pSwingSpeed)
  213.       PanoMovie("Direct", gPanoMovieID, "update")
  214.       PanoMovie("Direct", gPanoMovieID, "set", "transitionMode", "normal")
  215.       if pFinalQuality <> pSwingQuality then
  216.         PanoMovie("Direct", gPanoMovieID, "set", "quality", pFinalQuality)
  217.         PanoMovie("Direct", gPanoMovieID, "update")
  218.       end if
  219.     end if
  220.   end if
  221. end
  222.  
  223. on CollapsePanoMovie
  224.   if the machineType = 256 then
  225.     exit
  226.   end if
  227.   if not voidp(gPanoMovieID) then
  228.     if gPanoMovieID <> EMPTY then
  229.       PanoMovie("Direct", gPanoMovieID, "CollapseToHotSpotRgn")
  230.     end if
  231.   end if
  232. end
  233.  
  234. on SetPanoMovieView pHPan, pVPan, pZoom, pQuality
  235.   if the machineType = 256 then
  236.     SetPanoMovieView256(pHPan, pVPan, pZoom, pQuality)
  237.     exit
  238.   end if
  239.   if not voidp(gPanoMovieID) then
  240.     if gPanoMovieID <> EMPTY then
  241.       PanoMovie("Direct", gPanoMovieID, "set", "zoomAngle", pZoom)
  242.       PanoMovie("Direct", gPanoMovieID, "set", "vPanAngle", pVPan)
  243.       PanoMovie("Direct", gPanoMovieID, "set", "hPanAngle", pHPan)
  244.       if not voidp(pQuality) then
  245.         PanoMovie("Direct", gPanoMovieID, "set", "quality", pQuality)
  246.       end if
  247.       PanoMovie("Direct", gPanoMovieID, "update")
  248.     end if
  249.   end if
  250. end
  251.  
  252. on ClosePanoMovie
  253.   if the machineType = 256 then
  254.     ClosePanoMovie256()
  255.     exit
  256.   end if
  257.   if not voidp(gPanoMovieID) then
  258.     if gPanoMovieID <> EMPTY then
  259.       PanoMovie("Direct", gPanoMovieID, "dispose")
  260.       set gPanoMovieID to EMPTY
  261.     end if
  262.   end if
  263. end
  264.  
  265. on PanoFrameScript pSpriteNum
  266.   if the machineType = 256 then
  267.     PanoFrameScript256(pSpriteNum)
  268.     exit
  269.   end if
  270.   if rollOver(pSpriteNum) then
  271.     if (gPanoMovieID <> EMPTY) and (RunningInForeground() = "true") then
  272.       PanoMovie("Direct", gPanoMovieID, "mouseOver")
  273.       set tMouseOverResult to the result
  274.       if tMouseOverResult <> 0 then
  275.         set tAction to item 1 of tMouseOverResult
  276.         set tHotSpotID to item 2 of tMouseOverResult
  277.         if tAction = "jump" then
  278.           set gVR.CurrentNodeID to tHotSpotID
  279.         else
  280.           if tAction = "stil" then
  281.             set gVR.CurrentNodeID to tHotSpotID
  282.           else
  283.             if tAction = "navg" then
  284.               set gVR.CurrentHotSpotID to tHotSpotID
  285.               set tStartZoom to PanoMovie("Direct", gPanoMovieID, "get", "navgZoomRect")
  286.               set tViewAngles to PanoMovie("Direct", gPanoMovieID, "get", "navgViewAngles")
  287.               set tFileName to PanoMovie("Direct", gPanoMovieID, "get", "hotSpotName")
  288.               CollapsePanoMovie()
  289.               OpenNavMovie(gPathName & ":" & tFileName, 2, 0)
  290.               if gNavMovieID <> EMPTY then
  291.                 set gPanoFrame to marker(0)
  292.                 go("Object From Pano")
  293.                 SetNavMovieView(item 1 of tViewAngles, item 2 of tViewAngles)
  294.                 set spriteLeft to the left of sprite gVRSprite2
  295.                 set spriteTop to the top of sprite gVRSprite2
  296.                 set spriteRight to the right of sprite gVRSprite2
  297.                 set spriteBottom to the bottom of sprite gVRSprite2
  298.                 set tClipRect to spriteLeft & "," & spriteTop & "," & spriteRight & "," & spriteBottom
  299.                 ZoomNavMovie(tStartZoom, "true", tClipRect)
  300.               else
  301.                 PanoMovie("Direct", gPanoMovieID, "update")
  302.               end if
  303.             else
  304.               if tAction = "misc" then
  305.                 set gVR.CurrentNodeID to tHotSpotID
  306.               else
  307.                 if tAction = "undf" then
  308.                   set gVR.CurrentNodeID to tHotSpotID
  309.                   if tHotSpotID = 1 then
  310.                     set gVR to 0
  311.                     swingPyramid()
  312.                     advanceVR("Pyramid")
  313.                   else
  314.                     if tHotSpotID = 2 then
  315.                       set gVR to 1
  316.                       swingShip()
  317.                       advanceVR("Ship")
  318.                     end if
  319.                   end if
  320.                 else
  321.                   if tAction = "pan " then
  322.                   end if
  323.                 end if
  324.               end if
  325.             end if
  326.           end if
  327.         end if
  328.         set gLastTimeRollover to 1
  329.       else
  330.         if rollOver(pSpriteNum) then
  331.           set gLastTimeRollover to 1
  332.         else
  333.           cursor(200)
  334.           cursor(-1)
  335.           set gLastTimeRollover to 0
  336.         end if
  337.       end if
  338.     end if
  339.   else
  340.     if gLastTimeRollover then
  341.       cursor(200)
  342.       cursor(-1)
  343.       set gLastTimeRollover to 0
  344.       if gPanoMovieID <> EMPTY then
  345.         PanoMovie("Direct", gPanoMovieID, "idle")
  346.       end if
  347.     end if
  348.   end if
  349. end
  350.  
  351. on SampleMouseOverHandler
  352.   if the machineType = 256 then
  353.     exit
  354.   end if
  355.   put "Mouse over panoramic movie"
  356.   if gPanoMovieID <> EMPTY then
  357.   end if
  358. end
  359.  
  360. on SampleRolloverHandler pHotSpotID
  361.   if the machineType = 256 then
  362.     exit
  363.   end if
  364.   set gVR.CurrentHotSpotID to pHotSpotID
  365. end
  366.  
  367. on SampleMouseDownHandler
  368.   if the machineType = 256 then
  369.     exit
  370.   end if
  371.   put "Mouse down during mouseOver call"
  372.   if gPanoMovieID <> EMPTY then
  373.     PanoMovie("Direct", gPanoMovieID, "PassMouseDown")
  374.   end if
  375. end
  376.  
  377. on SamplePanZoomStartHandler
  378.   if the machineType = 256 then
  379.     exit
  380.   end if
  381.   put "About to pan or zoom in panoramic movie"
  382. end
  383.  
  384. on SampleMouseStillDownHandler
  385.   if the machineType = 256 then
  386.     exit
  387.   end if
  388.   put "Enter mouse still down from panoramic movie"
  389.   if gPanoMovieID <> EMPTY then
  390.   end if
  391.   put "Leave mouse still down from panoramic movie"
  392. end
  393.  
  394. on SampleNodeLeaveHandler pToNode
  395.   if the machineType = 256 then
  396.     exit
  397.   end if
  398.   put "Jumping to node " & pToNode & " in panoramic movie"
  399. end
  400.  
  401. on ExtractPathName pPathName
  402.   if the machineType = 256 then
  403.     ExtractPathName256(pPathName)
  404.     exit
  405.   end if
  406.   set tDelimiter to ":"
  407.   if pPathName contains tDelimiter then
  408.     set tCharPos to length(pPathName)
  409.     repeat while tCharPos >= 1
  410.       if char tCharPos of pPathName = tDelimiter then
  411.         return char 1 to tCharPos - 1 of pPathName
  412.       end if
  413.       set tCharPos to tCharPos - 1
  414.     end repeat
  415.     return EMPTY
  416.   else
  417.     return EMPTY
  418.   end if
  419. end
  420.  
  421. on SetupHandler pHandlerName
  422.   if the machineType = 256 then
  423.     exit
  424.   end if
  425.   if the hilite of cast (pHandlerName && "Check") then
  426.     PanoMovie("Direct", gPanoMovieID, "set", pHandlerName, "test" & pHandlerName)
  427.   else
  428.     PanoMovie("Direct", gPanoMovieID, "set", pHandlerName, EMPTY)
  429.   end if
  430. end
  431.  
  432. on TestMouseOverHandler
  433.   if the machineType = 256 then
  434.     exit
  435.   end if
  436.   if gPanoMovieID <> EMPTY then
  437.     set gVR.MouseOverHandler.Message to "In mouse over at: " & the ticks
  438.   end if
  439. end
  440.  
  441. on TestRolloverHotSpotHandler pHotSpotID
  442.   if the machineType = 256 then
  443.     exit
  444.   end if
  445.   if gPanoMovieID <> EMPTY then
  446.     set gVR.RolloverHotSpotHandler.Message to "Rolling over hot spot: " & pHotSpotID
  447.   end if
  448. end
  449.  
  450. on TestMouseDownHandler
  451.   if the machineType = 256 then
  452.     exit
  453.   end if
  454.   if gPanoMovieID <> EMPTY then
  455.     set gVR.MouseDownHandler.Message to "In mouse down at: " & the ticks
  456.     PanoMovie("Direct", gPanoMovieID, "PassMouseDown")
  457.   end if
  458. end
  459.  
  460. on testPanZoomStartHandler
  461.   if the machineType = 256 then
  462.     exit
  463.   end if
  464.   if gPanoMovieID <> EMPTY then
  465.     set gVR.PanZoomStartHandler.Message to "In pan zoom start at: " & the ticks
  466.   end if
  467. end
  468.  
  469. on TestMouseStillDownHandler
  470.   if the machineType = 256 then
  471.     exit
  472.   end if
  473.   if gPanoMovieID <> EMPTY then
  474.     set gVR.MouseStillDownHandler.Message to "In mouse still down at: " & the ticks
  475.     set gVR.MouseStillDownHandler.Message to PanoMovie("Direct", gPanoMovieID, "get", "hpanangle")
  476.   end if
  477. end
  478.  
  479. on TestNodeLeaveHandler pToNode
  480.   if the machineType = 256 then
  481.     exit
  482.   end if
  483.   if gPanoMovieID <> EMPTY then
  484.     set gVR.NodeLeaveHandler.Message to "Leaving node ID: " & pToNode
  485.   end if
  486. end
  487.  
  488. factory CallBackTracer
  489. method mnew
  490.  
  491. method mEvalExpr pExpr
  492.  
  493. method mSendHCMessage pMessage
  494.  
  495. method mSendCardMessage pMessage
  496.   do(pMessage)
  497.  
  498. method mGetFieldByName pCard, pName
  499.  
  500. method mGetFieldByNum pCard, pNum
  501.  
  502. method mGetFieldByID pCard, pID
  503.  
  504. method mSetFieldByName pCard, pName, pValue
  505.  
  506. method mSetFieldByNum pCard, pNum, pValue
  507.  
  508. method mSetFieldByID pCard, pID, pValue
  509.